package com.bitcola.security.activity.controller;

import com.bitcola.security.activity.biz.SignInLogBiz;
import com.bitcola.security.common.context.BaseContextHandler;
import com.bitcola.security.common.msg.AppResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("signin")
public class SignInController {



    @Autowired
    SignInLogBiz signInLogBiz;
    @RequestMapping(value = "sign")
    public AppResponse sign(){

        String userId = BaseContextHandler.getUserID();
        var log=  signInLogBiz.signIn(userId);

        return AppResponse.ok().data(log);
    }


    @RequestMapping(value = "query")
    public AppResponse query(int page,int size){

        String userId = BaseContextHandler.getUserID();
        var list=  signInLogBiz.query(userId,page,size);

        return AppResponse.ok().data(list);
    }






}
